﻿@using MvcPaging
@model IPagedList<CashOrCard.Models.AdvtSite>
<div id="search-page">
    <div class="search-condation">
        @Html.Partial("_QuickSearch")
    </div>
    <div class="search-result">
        <div class="image-slider" id="search-image-slider">
            <img src="~/images/search-ads/ad1.png" />
            <img src="~/images/search-ads/ad2.png" />
            <img src="~/images/search-ads/ad3.png" />
            <img src="~/images/search-ads/ad4.png" />
            <img src="~/images/search-ads/ad5.png" />
        </div>
        <script>
            $(function () {
                $('#search-image-slider').slidesjs({
                    width: 693,
                    height: 276,
                    play: {
                        active: false,
                        auto: true,
                        interval: 4000,
                        swap: true
                    },
                    pagination: {
                        active: true
                    },
                    navigation: {
                        active: false
                    }

                });
            });
                  </script>
         @using (Ajax.BeginForm("QuickSearch", "search",
                            new AjaxOptions { UpdateTargetId = "search-result-list", HttpMethod = "post", LoadingElementId = "loading", OnBegin = "beginPaging", OnSuccess = "successPaging", OnFailure = "failurePaging" },
                            new { id = "frm-search" }))
         {
                 
            <div>
                @{Html.RenderPartial("AjaxAdvtSiteList", Model);}
            </div>
         }
        <script type="text/javascript">

            function beginPaging(args) {
                // Animate
                $('#search-result-list').fadeOut('normal');
            }
            function successPaging() {
                // Animate
                $('#search-result-list').fadeIn('normal');                
            }
            function failurePaging() {
                alert("Could not retrieve list.");
            }
        </script>
    </div>
</div>
